<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function getSquare(a) {
      // console.log(`${a}的平方是${a * a}`)
      return a * a
    }
    function getSum(n = 0, m = 0) {
      let sum = 0
      for (let i = n; i <= m; i++) {
        sum += i
      }
      console.log(sum);
    }

    let a = +prompt('请输入你想要计算的平方数:')
    let n = +prompt('请输入第一个数:')
    let m = +prompt('请输入第二个数（比第一个数要大）:')

    let c = getSquare(a)
    console.log(c)
    console.log(getSquare())
    getSum(n, m)
  </script>
</body>

</html>